using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IGGameLevelMgr : IInit, IDispose, ILogicUpdate, ITick
{
    private static IGGameLevelMgr instance_;
    public static IGGameLevelMgr Instance
    {
        get
        {
            if (instance_ == null)
            {
                instance_ = new IGGameLevelMgr();
                instance_.Init();
            }
            return instance_;
        }
    }

    public void Dispose()
    {
        this._actorFactory.Dispose();
        this._actorManager.Dispose();
    }

    public void Init()
    {
        //----------Init GM Singleton------------------
        this._actorFactory = new ActorFactory();
        this._actorFactory.InitByGameLevel(this);
        this._actorManager = new ActorManager();
        this._actorManager.InitByGameLevel(this);
    }

    public void LogicUpdate(float detlatime)
    {
        this._actorManager.LogicUpdate(detlatime);
    }

    public void Tick()
    {
        this._actorManager.Tick();
    }

    //---------------------------GM Singleton------------------------------------
    private ActorFactory _actorFactory;
    public ActorFactory ActorFactory
    {
        get 
        {
            return _actorFactory;
        }
    }
    private ActorManager _actorManager;
    public ActorManager ActorManager 
    {
        get 
        {
            return _actorManager;
        }
    }
}
